<template>
  <div class="box">
    <BEcharts :option="option" />

    <div class="actions">
      <button type="button" @click="test">改变数据</button>
    </div>
  </div>
</template>

<script>
import BEcharts from './components/BEcharts/index.vue'
export default {
  name: '',
  components: {
    BEcharts
  },
  data() {
    return {
      option: {
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [150, 230, 224, 218, 135, 147, 260],
            type: 'line'
          }
        ]
      }
    }
  },
  created() {},
  mounted() {},
  methods: {
    test() {
      this.option = {
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [150, 230, 224, 218, 135, 147, 260],
            type: 'bar'
          }
        ]
      }
    }
  }
}
</script>

<style scoped lang="scss">
.box {
  height: 400px;
  background-color: #ccc;
}
</style>
